package com.bawei.a2010kotlin.room

import androidx.room.*

@Dao
interface StudentDao {
    //onConflict 冲突 当数据冲突REPLACE替换
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(student: Student)

    @Delete
    fun delete(student: Student)

    @Update
    fun update(student: Student)

    @Query("select * from student")
    fun select():MutableList<Student>
    //条件查询
    @Query("select * from student where name = :name")
    fun selectByName(name:String):MutableList<Student>
}